from imposm.parser import OSMParser

# simple class that handles the parsed OSM data.
class XMLscraper(object):
   def nodes(self,nodes):
       file1=open("latloniise.b","w") 
       for osm_id,tags,lat in nodes:
		if 'amenity' in tags and 'name' in tags:
                           line=str(osm_id)+";"+tags['name']+";"+str(lat[1])+";"+str(lat[0])+";"+tags['amenity']
                           uniline=repr(line)
                           file1.write(uniline[1:-1])
                           file1.write("\n")
       file1.close()                   
        

scraper = XMLscraper()

p = OSMParser(concurrency=4, nodes_callback=scraper.nodes)

p.parse('iise.osm')



